package com.weilai.lzt.sms3;

import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class EditActivity extends AppCompatActivity {
    private EditText editText;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit);
    }

    protected void editForm(View view){
        editText = findViewById(R.id.openid);
        String openid = editText.getText().toString();
        Log.i("lzt","submitForm被执行了  openid-->:"+openid);
        SharedPreferences.Editor editor = getSharedPreferences("openid", MODE_WORLD_WRITEABLE).edit();
        editor.putString("openid", openid);
        editor.commit();
        Toast.makeText(getApplicationContext(), "openid设置成功", Toast.LENGTH_LONG).show();
        Intent intent=new Intent(EditActivity.this, SuccessActivity.class);
        startActivity(intent);
    }
}
